﻿using System;
using System.Collections;

namespace Messenia.Data.Interfaces
{
    public interface IDataManager
    {
        #region Get Data 
        /// <summary>
        /// Returns all the stored data related to the object
        /// </summary>
        /// <typeparam name="T">Object Type</typeparam>
        /// <returns>List of the stored objects of given type</returns>
        IList GetAll(Type T);

        /// <summary>
        /// Returns stored data that matches given filter
        /// </summary>
        /// <typeparam name="T">Object Type</typeparam>
        /// <param name="filter">Conditions to match</param>
        /// <returns>List of the stored objects of given type</returns>
        IList GetFilteredData(Type T, object filter);
        #endregion

        #region Edit Data
        /// <summary>
        /// Save or update given object in the store
        /// </summary>
        /// <typeparam name="T">Object Type</typeparam>
        /// <param name="item">Item to save</param>
        /// <returns></returns>
        void Save(object entity);

        /// <summary>
        /// Detele given object from the store
        /// </summary>
        /// <typeparam name="T">Object Type</typeparam>
        /// <param name="item">Item to delete</param>         
        void Delete(object entity); 
        #endregion
        
    }
}
